<?xml version="1.0" encoding="utf-8"?>
<!--
   This file is a part of dcstore project,
   licensed under GPLv2
  
   Dominik Cebula
   dominikcebula@gmail.com
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core">    
    <h:body>
        <div class="module" id="cart">
            <div class="header">Cart</div>
            <div class="body">
                <c:choose>
                    <c:when test="#{cartWeb.products.size()==0}">
                        Cart is empty
                    </c:when>
                    <c:otherwise>
                        <h:dataTable value="#{cartWeb.products}"
                                     var="p"
                                     id="cart-products"
                                     columnClasses="name,qty">
                            <h:column>
                                <h:link value="#{p.product.name}"
                                        outcome="product.xhtml">
                                    <f:param name="id"
                                             value="#{p.product.id}" />
                                </h:link>
                            </h:column>
                            <h:column>
                                #{p.qty}
                            </h:column>
                        </h:dataTable>
                    </c:otherwise>
                </c:choose>

                <br /><br />
                <h:link outcome="cart-details.xhtml"
                        value=">> Show cart" />
            </div>
            <div class="bottom"></div>
        </div>
    </h:body>
</html>